From: robertl Date: Mon, 18 Jan 2010 02:37:06 +0000 (+0000) Subject: When writing bushnell_trl files, use output filename. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~199^2~76 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=febc60a52a43eedf5ce8a48320ebdf0bb48cf966;p=gpsbabel.git When writing bushnell_trl files, use output filename. --- diff --git a/bushnell.c b/bushnell.c index 513edf3a1..e05ecd87a 100644 --- a/bushnell.c +++ b/bushnell.c @@ -1,5 +1,5 @@ /* - Read and write Bushnellfiles. + Read and write Bushnell files. Copyright (C) 2008, 2009 Robert Lipe (robertlipe@gpsbabel.org) diff --git a/bushnell_trl.c b/bushnell_trl.c index e7d85a720..5f322e602 100644 --- a/bushnell_trl.c +++ b/bushnell_trl.c @@ -52,9 +52,18 @@ rd_deinit(void) { static void wr_init(const char *fname) { + int i,l = strlen(fname); + char obuf[20] = { 0 } ; + char *p = obuf; file_out = gbfopen_le(fname, "w", MYNAME); trkpt_count = 0; - static char obuf[20] = {"TL003"}; + for (i = 0; (i < l) && (i < 20); i++) { + char c = toupper(fname[i]); + if (isalnum(c)) + *p++ = c; + if (c == '.') + break; + } gbfwrite(&obuf, 1, 20, file_out); } diff --git a/xmldoc/formats/bushnell.xml b/xmldoc/formats/bushnell.xml index ad46192c4..6dd55172b 100644 --- a/xmldoc/formats/bushnell.xml +++ b/xmldoc/formats/bushnell.xml @@ -8,16 +8,31 @@ It's an oddity for many GPSBabel norms that this format requires each waypoint be in a separate file. Our "output filename" argument, -F is modified to take an "output filename template". The output filename you specify will have a dash, and a sequentially increasing integer, -and the ".wpt" extension appended to it. +and the ".wpt" extension appended to it. When the names are shown on +the GPS itself, the shortnames from the source format are used and not these +"made up" names. Command showing writing to Bushnell files Consider the case where 'whatever.gpx' holds three waypoints. - gpsbabel -i gpx -f whatever.gpx -o bushnell -F /Volumes/Bushnell/whatever + gpsbabel -i gpx -f whatever.gpx -o bushnell -F /Volumes/Bushnell/WAYPOINT/whatever will result in "whatever-0.wpt", "whatever-1.wpt", and "whatever-2.wpt" being credated in that directory. +Windows users may prefer the spelling: + + gpsbabel -i gpx -f whatever.gpx -o bushnell -F e:/WAYPOINT/whatever + + + + +At least for the 200CR, the directory name used by the device is "WAYPOINT" +in the root directory. It's also worth mentioning that its USB Mass Storage +protocol appears to not work on (at least) Snow Leopard 10.6.2. It's not +known if other Onix models have a more compatible USB implementation. + + diff --git a/xmldoc/formats/bushnell_trl.xml b/xmldoc/formats/bushnell_trl.xml index 0a17cac7e..a4ed29afe 100644 --- a/xmldoc/formats/bushnell_trl.xml +++ b/xmldoc/formats/bushnell_trl.xml @@ -5,7 +5,8 @@ receivers, notably the Onix 400. This format reads individual .trl files as written by the GPS. As this is -a reverse-engineered format, it's not understood how long tracks, in +a reverse-engineered format, it's not understood how (or even if) long +tracks, in particular, span multiple files so initially this format is most effective on tracks under a few thousand points. @@ -13,3 +14,8 @@ on tracks under a few thousand points. When writing tracks, a maximum of 4502 points is supported as this is the most we believe these units can represent in a track. + + The output base filename, converted to uppercase and stripped of + everything but letters and digits, is used for the trail name inside + the file itself. +